home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 May: Tool Chest / Dev.CD May 97 TC.toast / Sample Code / Toolbox / ModalList / ModalList.r < prev    next >
Encoding:
Text File  |  1994-11-18  |  4.0 KB  |  209 lines  |  [TEXT/MPS ]

  1. /*
  2. #
  3. #    Apple Macintosh Developer Technical Support
  4. #
  5. #    ModalList : Simple Modal Dialog and List Manager Sample Application
  6. #
  7. #    ModalList.r
  8. #
  9. #    Copyright © 1989 Apple Computer, Inc.
  10. #    All rights reserved.
  11. #
  12. #    Versions:    
  13. #            1.00                     10/89
  14. #            1.01                    06/92
  15. #
  16. #    Components:
  17. #            ModalList.make            October 1, 1989
  18. #            ModalList.h                October 1, 1989
  19. #            ModalList.c                October 1, 1989
  20. #            ModalListInit.c            June 12, 1992
  21. #            ModalList.r                October 1, 1989
  22. #            TCModalList.π            June 12, 1992
  23. #            TCModalList.π.rsrc        June 12, 1992
  24. #
  25. #    ModalList is an example application that demonstrates
  26. #    how to use the Dialog Manager and List Manager routines
  27. #    together. It is not a good example of a sample application
  28. #    but a great example of the use of lists in a dialog. The
  29. #    default LDEF is used to display a 2 dimensional list of strings.
  30. #    Each cell's string is initialized to represent it's position in the
  31. #    list. The user can change these strings and search for a particular
  32. #    cell value. Once again this is not meant as an example application and
  33. #    there are some features that are documented in the source listing
  34. #    that you should pay close attention to inorder to understand how
  35. #    this example works.
  36. #
  37. */
  38.  
  39. #include "SysTypes.r"
  40. #include "Types.r"
  41.  
  42. #include "ModalList.h"
  43.  
  44. resource 'vers' (1) {
  45.     0x01, 0x00, release, 0x00, verUS,
  46.     "1.00",
  47.     "1.00, Copyright © 1989 Apple Computer, Inc."
  48. };
  49.  
  50. /* this DLOG and DITL are used to display the list */
  51.  
  52. resource 'DLOG' (256) {
  53.     {32, 12, 330, 500},
  54.     plainDBox,
  55.     visible,
  56.     goAway,
  57.     0x0,
  58.     256,
  59.     "Dialog and List Manager Sample"
  60. };
  61.  
  62. resource 'DITL' (256) {
  63.     {    /* array DITLarray: 18 elements */
  64.         /* [1] */
  65.         {270, 303, 290, 363},
  66.         Button {
  67.             enabled,
  68.             "OK"
  69.         },
  70.         /* [2] */
  71.         {270, 398, 290, 458},
  72.         Button {
  73.             enabled,
  74.             "Cancel"
  75.         },
  76.         /* [3] OK Outline */
  77.         {270, 303, 290, 363},
  78.         UserItem {
  79.             enabled
  80.         },
  81.         /* [4] List View Rectangle */
  82.         {32, 32, 256, 256},
  83.         UserItem {
  84.             enabled
  85.         },
  86.         /* [5] */
  87.         {31, 289, 51, 396},
  88.         CheckBox {
  89.             enabled,
  90.             "lNoHilite"
  91.         },
  92.         /* [6] */
  93.         {51, 289, 71, 396},
  94.         CheckBox {
  95.             enabled,
  96.             "lUseSense"
  97.         },
  98.         /* [7] */
  99.         {71, 289, 91, 397},
  100.         CheckBox {
  101.             enabled,
  102.             "lNoRect"
  103.         },
  104.         /* [8] */
  105.         {91, 289, 111, 396},
  106.         CheckBox {
  107.             enabled,
  108.             "lNoExtend"
  109.         },
  110.         /* [9] */
  111.         {111, 289, 131, 396},
  112.         CheckBox {
  113.             enabled,
  114.             "lNoDisjoint"
  115.         },
  116.         /* [10] */
  117.         {131, 289, 151, 396},
  118.         CheckBox {
  119.             enabled,
  120.             "lExtendDrag"
  121.         },
  122.         /* [11] */
  123.         {151, 289, 171, 396},
  124.         CheckBox {
  125.             enabled,
  126.             "lOnlyOne"
  127.         },
  128.         /* [12] */
  129.         {194, 292, 213, 467},
  130.         EditText {
  131.             enabled,
  132.             ""
  133.         },
  134.         /* [13] */
  135.         {225, 301, 246, 362},
  136.         Button {
  137.             enabled,
  138.             "Set"
  139.         },
  140.         /* [14] */
  141.         {226, 396, 247, 457},
  142.         Button {
  143.             enabled,
  144.             "Find"
  145.         },
  146.         /* [15] */
  147.         {171, 272, 189, 484},
  148.         StaticText {
  149.             enabled,
  150.             "_____________________________"
  151.         },
  152.         /* [16] */
  153.         {15, 272, 32, 483},
  154.         StaticText {
  155.             enabled,
  156.             "_____________________________"
  157.         },
  158.         /* [17] */
  159.         {249, 272, 265, 483},
  160.         StaticText {
  161.             enabled,
  162.             "_____________________________"
  163.         },
  164.         /* [18] */
  165.         {104, 400, 143, 469},
  166.         StaticText {
  167.             enabled,
  168.             "Selection\n   Flags"
  169.         },
  170.  
  171.         /* [19] */
  172.         {8, 64, 22, 256},
  173.         StaticText {
  174.             disabled,
  175.             "ModalList by MacDTS"
  176.         },
  177.         /* [19] */
  178.         {270, 32, 286, 256},
  179.         StaticText {
  180.             disabled,
  181.             "Copyright © 1989 Apple Computer"
  182.         }
  183.     }
  184. };
  185.  
  186.  
  187. /* here is the quintessential MultiFinder friendliness device, the SIZE resource */
  188.  
  189. resource 'SIZE' (-1) {
  190.     dontSaveScreen,
  191.     ignoreSuspendResumeEvents,
  192.     disableOptionSwitch,
  193.     cannotBackground,            /* we don't background; we are a modal dialog only */
  194.     multiFinderAware,            /* this says we do our own activate/deactivate; don't fake us out */
  195.     backgroundAndForeground,    /* this is definitely not a background-only application! */
  196.     dontGetFrontClicks,            /* change this is if you want "do first click" behavior like the Finder */
  197.     ignoreChildDiedEvents,        /* essentially, I'm not a debugger (sub-launching) */
  198.     not32BitCompatible,            /* this app should not be run in 32-bit address space */
  199.     reserved,
  200.     reserved,
  201.     reserved,
  202.     reserved,
  203.     reserved,
  204.     reserved,
  205.     reserved,
  206.     cPrefSize * 1024,
  207.     cMinSize * 1024    
  208. };
  209.